package com.wskj.common.utils.common;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

/**
* Filename: AuthCodeUtils.java
* Description: 手机验证码
* Copyright: Copyright (c) 2016-2019 All Rights Reserved.
* Company: wsdz.com Inc.
*
* @author: gunk
* @version: 1.0
* Create at: 2022/8/17 14:50
*
* Modification History:
* Date Author Version Description
* ------------------------------------------------------------------
* 2022/8/17 guqk 1.0 1.0 Version
*/
public class AuthCodeUtils {
	public static synchronized String smsCode() {
		String random = (int) ((Math.random() * 9 + 1) * 100000) + "";
		return random;

	}

	/**
	 * 22位的编号。
	 *
	 * @return {String}
	 */
	public static synchronized String getOrderNo() {
		SimpleDateFormat format = new SimpleDateFormat("YYYYMMddHHmmssSSS", Locale.getDefault());
		Date date = new Date();
		String key = format.format(date);
		key = key + System.currentTimeMillis();
		key = key.substring(0, 15);
		return key+((int)(Math.random()*10)+"");
	}
}
